// v 1.1.2

// dialoguescript for town 5: Voughton

begintalkscript;

variables;

int coins_before;

// *** Mayor Ruth ***

begintalknode 1;
	state = -1;
	personality = 29;
	nextstate = 1;
	condition = 1;
	question = "Mayor Ruth";
	text1 = "In front of you stand a woman wearing lovely clothes. She wears glasses and is reading a book. When she spots you, she takes her glasses off and stands up. _I'm Mayor Ruth. What can I do for you?_";
	text2 = "_The Empire Liaison was kidnapped! Someone must go and search him!_";
	text3 = "Mayor Ruth is having a conversation with the highest commander of the Riverrod Empire Headquarters. When she sees you, however, she interrupts him, and asks you what you want.";
	text4 = "Mayor Ruth is very upset. The leader of the Empire headquarters who also sits at the table also doesn't seem too pleased. Mayor Ruth spots you and shouts at you: _The Empire Liaison has been kidnapped!_";
	code =
		if (get_flag(17,5) != 1) { // leader Empire HQ is not here
				if (get_flag(5,2) == 1) { // liaison kidnapped
						remove_string(1);
						remove_string(3);
						remove_string(4);
						}
				}
		
		if (get_flag(17,5) != 1) {
				if (get_flag(5,2) == 0) { // liaison not kidnapped
						remove_string(2);
						remove_string(3);
						remove_string(4);
						}
				}
		
		if (get_flag(17,5) != 1) {
				if (get_flag(5,3) == 2) {
						add_string(1);
						remove_string(2);
						remove_string(3);
						remove_string(4);
						}
				}
		
		if (get_flag(17,5) == 1) { // leader Empire HQ is here
				if (get_flag(5,2) == 0) { // liaison not kidnapped
						remove_string(1);
						remove_string(2);
						remove_string(4);
						}
				}
		
		if (get_flag(17,5) == 1) {
				if (get_flag(5,2) == 1) { // liaison kidnapped
						remove_string(1);
						remove_string(2);
						remove_string(3);
						}
				}
		
		if (get_flag(17,5) == 1) {
				if (get_flag(5,3) == 2) {
						remove_string(1);
						remove_string(2);
						add_string(3);
						remove_string(4);
						}
				}
	break;
	
begintalknode 2;
	state = 1;
	personality = 29;
	nextstate = 2;
	condition = 1;
	question = "What tasks do you have?";
	text1 = "_Nothing of too much importance. I deal with budgets, all kinds of laws, send police when they are needed, that sort of thing. Naturally, there are things I can not do._";

begintalknode 3;
	state = 2;
	personality = 29;
	nextstate = 3;
	condition = 1;
	question = "What things may that be?";
	text1 = "_Well, there have been some problems lately. And... I wondered if you can help me out?_";
	text3 = "_Did you eliminate the bandits already? No, you didn't. First eliminate them, and then I'll see if there is more to do._ She returns to her book again.";
	text5 = "_At the moment nothing, actually. You eliminated the most immediate threat this city had already._ She doesn't look disappointed when saying this, she is glad there is no threat to the city! _Of course, we have the Senarti..._";
	code =
		if (get_flag(5,0) == 0) {
				remove_string(3);
				remove_string(5);
				}
				
		if (get_flag(5,0) == 1) {
				remove_string(1);
				remove_string(5);
				}
				
		if (get_flag(5,0) == 2) {
				remove_string(1);
				remove_string(3);
				}
		break;
	
begintalknode 4;
	state = 3;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,0) == 0;
	question = "Well of course!";
	text1 = "_Thanks very much. Several bandits live in the sewers of this town. No police officer or guard wants to go down because of poison fungi, rats, bats and a very annoying smell. If you could get rid of the bandit leader, I would be grateful._";
	text2 = "The entrance to the sewers is in a small cabin at the south end of town. You can't miss it. It's guarded by two guards.";
	code = 
		set_flag(5,0,1);
		set_flag(5,11,1);
		toggle_quest(1,1);
	break;

begintalknode 5;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,0) == 1 && get_flag(6,1) == 1;
	question = "We killed them all! Wow, that was fun!";
	text1 = "She smiles at you. She is clearly relieved at least one threat has been taken care off. _Very good. You deserve a reward._ She claps her hands, and a guard brings you a sack of gold.";
	code = 
		toggle_quest(1,0);
		set_flag(5,0,2);
		award_party_xp(100,30);
	break;

begintalknode 6;
	state = 1;
	personality = 29;
	nextstate = 1;
	condition = get_flag(6,5) == 1;
	question = "We found this note in the bandit leader's desk.";
	text1 = "She takes the note. Her smile fades away and she looks worried. _This is serious. These bandits were actually helping the Senarti! On this letter to the chief bandit, there is a whole description of how to kidnap the Empire Liaison!_";
	text2 = "She takes the note. Her smile fades away and she looks worried. _In this letter there is a complete explanation of how the Empire Liaison should have been kidnapped!_ She turns her head away. _It seems they succeeded._";
	text3 = "After reading the note, she falls down in her chair, and starts breathing heavily. She doesn't look healthy at all, and her skin is a bit pale.";
	code =
		if (get_flag(5,2) == 0) {
				remove_string(2);
				change_spec_item(9,-1);
				set_flag(6,5,2);
				}
		
		if (get_flag(5,2) == 1) {
				remove_string(1);
				change_spec_item(9,-1);
				set_flag(6,5,2);
				}
	break;

begintalknode 7;
	state = 1;
	personality = 29;
	nextstate = 1;
	condition = get_flag(6,1) == 1 && get_flag(5,0) == 2;
	question = "How have things been going since we got rid of the bandits?";
	text1 = "_Quite good, thank you. Disturbances have been smaller, and the people seem happier. Its also less noisy and messy in town._";

begintalknode 8;
	state = 5;
	personality = 29;
	nextstate = 5;
	condition = 1;
	question = "Benthol? That sounds like some sort of medicine.";
	text1 = "_Funny, that is just what I thought when I heard the name first time._";

begintalknode 9;
	state = 5;
	personality = 29;
	nextstate = 5;
	condition = 1;
	question = "Why does a mage want to talk to us?";
	text1 = "_I don't know. He heard about you what you are doing. He came to me to ask if I could ask you to go talk to him. Just see what he wants._";

begintalknode 10;
	state = 3;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,11) == 0;
	question = "No. We already have enough to do.";
	text1 = "_What a pity. Well, then I will have to find someone else to do it, but if you change your mind, you can always come back and ask for it_";
	
begintalknode 11;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,3) < 1 && get_flag(5,2) == 1;
	question = "Was the Empire Liaison kidnapped!? But how!";
	text1 = "_They came at night and simply kidnapped him. You must go and look for him. I fear for his life._";
	code =
		toggle_quest(2,1);
		set_flag(5,3,1);
		set_town_visibility(7,1);
	break;
	
begintalknode 12;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = get_flag(7,0) == 1 && get_flag(5,3) <=1 && get_flag(5,2) == 1 && get_flag(5,4) <= 1;
	question = "We found the Empire Liaison, but we're afraid he is dead.";
	text1 = "_Oh no. I was afraid this would happen. When people get kidnapped you know, you always keep hoping, but I already had the feeling, that..._";
	text2 = "She sighs and a tear drops on her dress. She looks at you with eyes full of grief, but she suddenly recovers, and says to you: _Please, find the one who did this._ You nod and leave.";
//	text3 = "You leave her alone. Before you can leave however, she calls you back. _There were some scrolls stolen. If you happen to find them, come back to me._";
	code =
		toggle_quest(2,0);
//		toggle_quest(3,1);
		set_flag(5,3,2);
//		set_flag(5,4,1);
		set_flag(5,2,2);
	break;

//begintalknode 13;
//	state = 1;
//	personality = 29;
//	nextstate = -1;
//	condition = get_flag(5,4) == 1;
//	question = "We would like to discuss something about the stolen scrolls";
//	text1 = "_She sits and smiles. But when you tell her what you know, that smile quickly fades..._";
//	code = 
//		if (get_flag(8,8) == 1) {
//				set_flag(8,8,2);
//				reset_dialog();
//				add_dialog_str(0,"You tell her what you discovered. When you tell her of the book and the hard-to-read words which makes you suspect minions of Thralni maybe kidnapped the Empire Liaison, she becomes furious.",0);
//				add_dialog_str(1,"_How dare you say that about Emperor Thralni!_ You quickly move away.",0);
//				add_dialog_choice(0,"Okay");
//				run_dialog(1);				
//				}
//			if (get_flag(4,1) == 1) {
//					set_flag(4,1,2);
//					toggle_quest(3,0);
//					award_party_xp(40,10);
//					change_coins(100);
//					run_town_script(12);
//					}
//				run_town_script(13);
//	break;
	
begintalknode 14;
	state = 1;
	personality = 29;
	nextstate = 31;
	condition = 1;
	question = "Can we assist you with the Senarti problem?";
	text1 = "_Assist me? Of course you can! Start out by wiping out their fort. Come back to me when you complete that task. In that case, there is something bigger I want you to do._ She sits down and begins reading her book.";
	text2 = "She stops reading for a moment and looks at you. _You know, before going to that fort, it is maybe best to go to a small hideout where a small army is stationed. They have been spying on the Senarti for some time now. Go there first._";
	text3 = "_I gave you a quest, didn't I? Anyway, go to the Senarti fort and wipe it out. that will be one problem less to deal with._ She continues reading her book.";
	text4 = "_What are you still doing here? You should go! find a way to stop these Senarti's!_ She is indeed not pleased to see you here, instead of getting rid of the Senarti.";
	text5 = "When you talk to her, she doesn't seem very patient. _What's wrong? Shouldn't you go to find the one who caused this mess?_";
	code =
		if (get_flag(5,10) == 0) {
				remove_string(3);
				remove_string(4);
				remove_string(5);
				}
				
		if (get_flag(5,10) == 1) {
				remove_string(1);
				remove_string(2);
				remove_string(4);
				remove_string(5);
				}
				
		if (get_flag(5,16) == 1) {
				remove_string(1);
				remove_string(2);
				remove_string(3);
				remove_string(5);
				
				}
		if (get_flag(5,1) == 1) {
				remove_string(1);
				remove_string(2);
				remove_string(3);
				remove_string(4);
				}
	break;

begintalknode 15;
	state = 31;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,10) == 0;
	question = "We'll try.";
	text1 = "_That would be very good of you to do. Thanks very much. We must eliminate these Senarti for ever. And don't forget to go to that fort._ She tells you exactly where to find the fort. From now on, you'll be able to see where the fort is.";
	code =
		toggle_quest(8,1);
		set_flag(5,10,1);
		set_town_visibility(42,1);
	break;
		
begintalknode 16;
	state = 1;
	personality = 29;
	nextstate = 5;
	condition = get_flag(11,5) == 1 && get_flag(11,6) == 1 && get_flag(5,10) == 1;
	question = "We killed the two leading characters of the Senarti fort.";
	text1 = "_That's very good news in these dark days._ She gives you a sack of gold. _Now tell me about that fort._ You tell her about the fort and the beautiful things inside. She seems amazed, although she knows all things told about them.";
	text2 = "_I never thought that Senarti folk was really so high evolved. They are tougher then I thought, although they already destroyed a village and the beautiful city of Summertown._ When you tell her about the magi, she looks even more worried.";
	text3 = "_I think I'll better give you your next quest then. I want you to investigate the Senarti. I don't know where they come from, but I want you to make an end to it. Now go, you mustn't lose any time here talking to some old mayor._";
	text4 = "However, when you are about to leave her room, she shouts at you. _Wait! Stop! Some old mage, Benthol, wanted to talk to you!_";
	code =
		set_flag(5,29,1);
		set_flag(5,10,2);
		toggle_quest(8,0);
		toggle_quest(9,1);
		set_flag(5,16,1);
		set_flag(5,6,1);
		set_flag(5,11,2); // Does this have any use?
		change_coins(500);
		award_party_xp(150,20);
	break;

begintalknode 17;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,16) == 1 && get_flag(22,9) == 1;
	question = "Mayor, we found and destroyed the place where the Senarti came from!";
	text1 = "She listens patiently to you. _I wish I could kill the one who did this._ She stands up and walks over to you. _Find the one responsible and my rewards will be priceless._ She sits down again.";
	text2 = "As you're starting to walk to the door, she calls you back. _Wait. This can be dangerous. I don't know who can create such a thing, but whoever made it, is probably very powerful. I first want you to go back to the Creation halls._";
	text3 = "You look at her with big eyes. Why go back? _Maybe there is something there, information, I don't know. I think you should just do that first._ She sits down and begins reading her book. She nearly finished it.";
	code =
		set_flag(5,16,2);
		toggle_quest(9,0);
		award_party_xp(100,20);
		toggle_quest(10,1);
		set_flag(5,17,1);
		set_flag(27,0,5);
		set_flag(5,1,1);
		run_town_script(16);
	break;

begintalknode 18;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "";

begintalknode 19;
	state = 1;
	personality = 29;
	nextstate = -1;
	condition = get_flag(7,3) == 2;
	question = "Mayor Ruth, we found this paper in the cave where the body of the Empire Liaison was lying. This ring has the same sign as on the paper. It's Thralni's.";
	text1 = "She looks startled at you. _This can't be. The Emperor would never do such a thing. You should however, continue your search. Maybe you'll find something important._";
	code =
		set_flag(7,3,3);
	break;

// *** Benthol ***

begintalknode 20;
	state = -1;
	personality = 38;
	nextstate = 6;
	condition = 1;
	question = "Benthol";
	text1 = "An old mage sits at a table. His house is quite nice. It is small, but has everything he needs. Something that you immediately notice is all the antiques and stuff. You wonder why its all here.";

begintalknode 21;
	state = 6;
	personality = 38;
	nextstate = 8;
	condition = get_flag(5,6) == 1;
	question = "You said you wanted to talk to us?";
	text1 = "_Very good._ So she gave you my message (cough)._ An evil laugh takes him over for a few seconds. _Hahahahaaa! Now the tide will turn! Oh, sorry (giggle). Didn't want to scare you. But indeed. There is something I need you to do. My reward is priceless._";

begintalknode 22;
	state = 6;
	personality = 38;
	nextstate = 7;
	condition = get_flag(1,10) == 1;
	question = "Flanagan, the mage in Pleasantville, said you know things about the Senarti?";
	text1 = "He nods. _Ah, yes. The ever cunning and dangerous Senarti. what would you want to know?_ He folds his arms over each other, and looks at you as an old, wise professor would have done. Its cute.";

begintalknode 23;
	state = 7;
	personality = 38;
	nextstate = 7;
	condition = 1;
	question = "We would like to know more about their history.";
	text1 = "_In that (cough) respect, I will have to disappoint you. Nobody actually knows where they came from, how they came to existence and why they came here._ While he says that, he sits back in his chair, awaiting a response.";

begintalknode 24;
	state = 7;
	personality = 38;
	nextstate = 7;
	condition = 1;
	question = "Could you tell us about their connections with humans? Flanagan told us about a conspiracy?";
	text1 = "_They are smart. They know how to manipulate people and their magi are very powerful, more powerful then the average mage or priest. They are even more powerful than me! Can you imagine that?!_ He nods in disgust, with big eyes.";
	text2 = "_Anyway, yes. They probably get orders from humans, though nobody proved that as yet. Flanagan is a powerful and cunning wizard, but he is getting old. Don't believe him too soon. He is known for being suspicious._";
	code =
		set_flag(5,25,1); // new talking options with Mayor Ruth.
	break;

begintalknode 25;
	state = 7;
	personality = 38;
	nextstate = 7;
	condition = 1;
	question = "Can you tell us about their magi?";
	text1 = "_They are extremely powerful. You should be careful when approaching one. They know many dangerous spells and they tend to use them without fear, what probably means they control them well. Look out when fighting with a Senarti mage._";
	text2 = "_Their priests are also quite powerful. I don't know how they do it, but they are quite strong in magic. I also heard they tend to use strong potions. Again: watch out when fighting them._";

begintalknode 26;
	state = 6;
	personality = 38;
	nextstate = -1;
	condition = get_flag(10,0) == 1 && get_flag(5,7) == 2;
	question = "Your spell didn't work, I'm afraid.";
	text1 = "He laughs at you, with an evil grin. _Of course not! Do you think I'm so naive to let you give me a false scepter!? I demand that you give me the right one now!_";
	code =
		set_flag(5,7,1);
		change_spec_item(3,-1);
	break;
		

begintalknode 27;
	state = 8;
	personality = 38;
	nextstate = 8;
	condition = get_flag(5,8) < 2;
	question = "What valuable information do you want to give us?";
	text1 = "_Sorry, I will only give you that when you completed the quest I have for you._";
	code =
		if (get_flag(5,8) < 2)
				set_flag(5,8,1);
	break;

begintalknode 28;
	state = 8;
	personality = 38;
	nextstate = -1;
	condition = get_flag(5,8) == 2;
	question = "What information did you have for us?";
	text1 = "_I already gave it to you. Now go._";

begintalknode 29;
	state = 8;
	personality = 38;
	nextstate = -1;
	condition = get_flag(5,8) == 1;
	question = "What do you want us to do?";
	text1 = "_Before I give you anything, there is a small thing I want you to get for me. As you have seen I'm a collector of antiques, and I particularly like wands and magical stuff._";
	text2 = "He looks at you with big eyes. _However, I'm getting old, and I have difficulty travelling. This means I can't go out there to just collect more items for my collection. That is where you come in. There is this wand, you see..._";
	text3 = "A grin appears on his face. He seems quite pleased to have found somebody to search for this wand for him. _I want you to bring the wand. It's in a crypt, in the south-western corner of Riverrod. Bring it to me, and I'll give you your reward._";
	code = 
		toggle_quest(4,1);
		set_flag(5,8,1);
		set_town_visibility(13,1);
	break;

begintalknode 30; // the real scepter
	state = 6;
	personality = 38;
	nextstate = -1;
	condition = get_flag(5,8) == 1 && get_flag(13,0) == 1 && get_flag(5,9) <= 1;
	question = "We finally found the scepter. Here it is.";
	text1 = "When you tell him you got the wand, he stands up and grabs the wand out of your hands. _Finally!_ He walks to a closet and takes a yellowish piece of paper out of. He teaches you the spell written on it.";	
	text2 = "_My friends, you have made the day of an old man. This spell will enable you to get through the gates of Thralni's castle._ He takes the paper away and puts it in the closet.";
	text3 = "_Beware, because Thralni's castle is a dangerous place and I don't know what's in there._ He walk away to his table and sits down again. _Good luck._";
	code =
		toggle_quest(4,0);
		set_flag(5,8,2);
		set_flag(5,7,1);
		change_spec_item(3,-1);
	break;

begintalknode 31; // the false scepter
	state = 6;
	personality = 38;
	nextstate = -1;
	condition = get_flag(5,8) == 1 && get_flag(13,1) == 1;
	question = "This is the scepter you asked us to bring you.";
	text1 = "When you tell him you got the wand, he stands up and grabs the wand out of your hands. _Finally!_ He walks to a closet and takes a reddish piece of paper out of. He teaches you the spell written on it.";
	text2 = "_Now you will be able to get into Thralni's castle. I wish you good luck._ After saying this, he takes the paper and sits down at the table.";
	code =
		toggle_quest(4,0);
		set_flag(5,8,2);
		set_flag(5,7,2);
		change_spec_item(4,-1);
	break;

begintalknode 32;
	state = 9;
	personality = 38;
	nextstate = 6;
	condition = 1;
	question = "Why do you think Voughton will be the next on the list? The city is well defended, isn't it?";
	text1 = "_Yes, it is, but if you look around... Have you seen Summertown already? Its ruined! Once it was a nice, rather large town. It also was well defended. My god, they even had a fort, Fort Filbert, quite close to them! Look what happened!_";

begintalknode 33;
	state = 9;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "These Senarti really are a pest, aren't they.";
	text1 = "His face darkens. _You tell me? Look around. Look at what they did. Destroyed two lovely towns, and destroyed with it all happiness this province once had._ Tears fall on his clothes. You decide to leave.";
	action = END_TALK;

begintalknode 34;
	state = 6;
	personality = 38;
	nextstate = 10;
	condition = 1;
	question = "We noticed all the antiques, what do you do with it?";	
	text1 = "He starts smiling when you ask him this. _I'm a collector of antiques. I've spent about ten years coming this far. Look around, be amazed._ You start looking around. There are indeed nice items among the rubbish.";

begintalknode 35;
	state = 10;
	personality = 38;
	nextstate = 10;
	condition = 1;
	question = "There are indeed nice items here";
	text1 = "He smiles. _I'm an old man, but I'm determined to get the most valuable items one can get, and I'm already on the way. As you can see, I already have some nice items._ He points at a dusty, broken wand. _Well... Its broken now, of course._";
	
begintalknode 36;
	state = 10;
	personality = 38;
	nextstate = 11;
	condition = 1;
	question = "So why did you start collecting antiques?";
	text1 = "_Once, I was a mage. Quite a successful one, but then the accident happened. I was busy with my research, when one of the beasts I experimented on broke loose. It caused enormous damage. My research was lost, and so was my patience._";

begintalknode 37;
	state = 11;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "What was the thing you did research on?";
	text1 = "_Um... that, that is a secret! You mustn't know any of that!_ He doesn't look very happy with this question. _You mustn'tmusn't know anything about that!_ He starts screaming. You try to calm him down, but you soon leave. Its no use calming him down.";
	action = END_TALK;
	code =
		set_flag(5,24,1);
	break;
	
begintalknode 38;
	state = 6;
	personality = 38;
	nextstate = 9;
	condition = 1;
	question = "Could you tell us anything about this city?";
	text1 = "_This city fares well, if that's what you want to know. The only problem at the moment is the Senarti. They keep ransacking Riverrod, and one day they will come, and Voughton will be its victim too._";

// *** Jordan ***

begintalknode 39;
	state = -1;
	personality = 30;
	nextstate = 12;
	condition = 1;
	question = "Jordan";
	text1 = "_Hi, I'm the Empire Liaison._ The man saying this is indeed the Empire Liaison. A small sign on his uniform acknowledges this. The poor man is buried under all kind of Empire scrolls and papers.";

begintalknode 40;
	state = 12;
	personality = 30;
	nextstate = 13;
	condition = 1;
	question = "You're the Empire Liaison. So what do you do?";
	text1 = "_My job is to discuss things with the mayors of the towns of Riverrod and discuss these same things also with the Empire officials in other provinces. There is a big Empire HQ in Riverrod, by the way._";
	text2 = "He looks proud he can say this. _It was built a few years ago. I suggest for any matters containing the Empire you go there._";

begintalknode 41;
	state = 13;
	personality = 30;
	nextstate = -1;
	condition = 1;
	question = "Where exactly is it?";
	text1 = "_Its east of Stracton and Fort Filbert, so its not so far._";
	text2 = "_Now I think of it, Stracton was destroyed by the Senarti, wasn't it? I should talk about this at my next meeting with the Empire Liaison's of other provinces. Anything else I can help you with?_";

begintalknode 42;
	state = 12;
	personality = 30;
	nextstate = 14;
	condition = 1;
	question = "We'd like to know more about this province.";
	text1 = "_What would you exactly like to know?_ He smiles. _Only about the Senarti I suggest you go first to other people who know more about it._";

begintalknode 43;
	state = 14;
	personality = 30;
	nextstate = 14;
	condition = 1;
	question = "How about the cities.";
	text1 = "_All goes well. The only problem is tourism. With the Senarti and their raids, many people avoid Riverrod.";

begintalknode 44;
	state = 14;
	personality = 30;
	nextstate = 15;
	condition = 1;
	question = "Tell us about the religions here.";
	text1 = "His smile slowly fades away. _Not much to tell about._ His smile disappeared completely now. He almost seems angry.";

begintalknode 45;
	state = 15;
	personality = 30;
	nextstate = 12;
	condition = 1;
	question = "What's the problem with the religion here? You looked so depressed when we mentioned it.";
	text1 = "_What? Sorry. The religion here. Its nothing, really. What else do you want to know?";

begintalknode 46;
	state = 12;
	personality = 30;
	nextstate = -1;
	condition = 1;
	question = "What about Thralni?";
	text1 = "His eyes lighten up. Ah! Yes. Thralni. That never-ending pest. I'd like to have him out of the way, you know. But please, stop asking about him. He just irritates me. If you want to know more about him, go to the Empire HQ._";
	text2 = "He begins to write a small note and gives it to you. _This will grant you excess to the archives. Without this note you will still be able to look at the archives, but that archive wizard there will have to stay close to you all the time._";
	text3 = "_I already gave you that note, didn't I?_ You nod. _Well, what are you wasting my time for, then? Go to the archives._";
	text4 = "_Was that all you wanted to know?_";
	code =
		if (get_flag(5,15) == 0) {
				remove_string(3);
				change_spec_item(0,1);
				set_flag(5,15,1);
				}
		
		if (get_flag(5,15) == 1)
				remove_string(2);
	break;

// *** Mother Sophia ***

begintalknode 47;
	state = -1;
	personality = 31;
	nextstate = 16;
	condition = 1;
	question = "Mother Sophia";
	text1 = "This elegantly dressed priestess is the keeper of this temple. She's pleased to see somebody. _Hello, what can I do for you?_";

begintalknode 48;
	state = 16;
	personality = 31;
	nextstate = 17;
	condition = 1;
	question = "What services do you provide?";
	text1 = "_Several things, actually. I can maybe teach you some spells, although they are quite weak. You know what, go to Mother Erika in Pleasantville. She'll teach you some very good spells. I can also tell you my views on the world._";

begintalknode 49;
	state = 17;
	personality = 31;
	nextstate = 17;
	condition = 1;
	question = "Can't you really teach us some spells?";
	text1 = "She stops smiling. _Look, I already said you'd better go to Mother Erika, all right?_";

begintalknode 50;
	state = 17;
	personality = 31;
	nextstate = -1;
	condition = 1;
	question = "Tell us about your views on the world.";
	text1 = "She seems pleased you want to hear them. _Many years ago, I believe, a man came to us, saying his name is Father Meatloaf. Bla bla bla bla...._ She starts telling you a whole story. You listen, but it certainly doesn't interest you.";

// *** Boris ***

begintalknode 51;
	state = -1;
	personality = 39;
	nextstate = 18;
	condition = 1;
	question = "Boris";
	text1 = "_Good day, folks. What can I do for you?_ a smiling man says to you when you come into this nice little tavern. _We've got cheap rooms (only 10 coins! Nice and clean) and nice food (only 5 coins), directly from Pleasantville's bakers._";

begintalknode 52;
	state = 18;
	personality = 39;
	nextstate = -1;
	condition = 1;
	question = "We'd like to have a room, please.";
	text1 = "He takes your coins and brings you to your room. _Here's your room. I'm sorry, but we offer no breakfast._ He walks away to the tavern.";
	text3 = "_Sorry sir, but we don't have enough money..._ You say, a little embarrassed. _Then no room for you, sonny._";
	text5 = "_Horses are not allowed in the rooms, folks._";
	action = INN 10 20 32;

begintalknode 53;
	state = 18;
	personality = 39;
	nextstate = -1;
	condition = 1;
	question = "We'd like to eat something.";
	text1 = "_Very well. Here are four lovely loaves of bread. Take a seat._ You pay him and get seated. The bread is wonderful.";
	action = INN 5 13 27;
	code = 
		change_coins(-5);
		relocate_character(0,13,27);
		relocate_character(1,14,27);
		relocate_character(2,13,29);
		relocate_character(3,14,29);
		revive_party();
	break;

begintalknode 54;
	state = 18;
	personality = 39;
	nextstate = 19;
	condition = 1;
	question = "How is business?";
	text1 = "His smile fades away. _Since the Senarti showed up its always going down. Last year I had at least twice as many customers._";

begintalknode 55;
	state = 19;
	personality = 39;
	nextstate = -1;
	condition = 1;
	question = "That Senarti folk really isn't good for anybody here, is it?";
	text1 = "_Yes, I know._ He looks slightly depressed. _I hope somebody would kill them all!_ He walks towards a chair and sits on it.";
	text2 = "_Anyway, is there something else I can do for you?_ He walks back to the bar again, ready to be at your service.";

// *** Wellroy ***

begintalknode 56;
	state = -1;
	personality = 32;
	nextstate = 20;
	condition = 1;
	question = "Wellroy";
	text1 = "You enter a nice small shop. On the counter different sorts of food are laid out for you, so you can take a look at it. _How are you doing, folks?_ a man shouts happily at you when you come in.";

begintalknode 57;
	state = 20;
	personality = 32;
	nextstate = 21;
	condition = 1;
	question = "What exactly can you offer us?";
	text1 = "_Well, I've food and food, and food, and... Um... I also have some food._ You are amazed by the apparently big choice of options.";

begintalknode 58;
	state = 21;
	personality = 32;
	nextstate = 20;
	condition = 1;
	question = "I think we'll buy some food then.";
	text1 = "You put your newly bought stuff in your bags.";
	code =
		begin_shop_mode("Wellroy's Corner Deli","Everywhere meat and greens are stacked. It looks delicious.",11,1,-1);
	break;

begintalknode 59;
	state = 20;
	personality = 32;
	nextstate = -1;
	condition = 1;
	question = "What a nice shop this is.";
	text1 = "He smiles. _Thanks. Its a family business. My son should be walking around here somewhere. His name is Pete. Anyway, is there something else I can help you with?_";
	code =
		set_flag(5,13,1);
	break;

// *** Pete ***

begintalknode 60;
	state = -1;
	personality = 46;
	nextstate = 22;
	condition = 1;
	question = "Pete";
	text1 = "A young boy is playing in the streets of Voughton. He smiles and has a good time, when playing with his self-fabricated toy.";
	text3 = "This must be Pete, the son of Wellroy, the food salesman of the _Corner Deli._ He smiles and has a good time, when playing with his self-fabricated toy.";
	code =
		if (get_flag(5,13) == 0)
				remove_string(3);

		if (get_flag(5,13) == 1)
				remove_string(1);
	break;

begintalknode 61;
	state = 22;
	personality = 46;
	nextstate = -1;
	condition = 1;
	question = "Hi, hello there little boy. What are you doing?";
	text1 = "_I'm playing with my cars, sir._ His blond hair is all dirty because of the mud he just stood up from. He runs away though.";
	action = END_TALK;

// *** Monard ***

begintalknode 62;
	state = -1;
	personality = 33;
	nextstate = 23;
	condition = 1;
	question = "Monard";
	text1 = "This shop is a bit stuffy. A wise looking man sits at the counter. He apparently doesn't seem to notice you just came in. You walk in front of his desk. When he still doesn't seem to notice you, you tap him on the shoulder.";
	text2 = "_Oh, I'm sorry. I didn't hear you come in. How can I help you?_ At last, he notices you're there.";

begintalknode 63;
	state = 23;
	personality = 33;
	nextstate = 23;
	condition = 1;
	question = "I see you've potions here. We'd like to buy some.";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Monard's Potions","This shop is stuffed with potions. There are even some drawings of potions on the walls.",12,3,-1);
	break;


begintalknode 64;
	state = 23;
	personality = 33;
	nextstate = 24;
	condition = 1;
	question = "What else can you offer us except for potions?";
	text1 = "_I can offer you potions, my friends._ You look at him with amazement.";

begintalknode 65;
	state = 24;
	personality = 33;
	nextstate = -1;
	condition = 1;
	question = "Um... No, I said, something OTHER than potions.";
	text1 = "He apparently is a bit deaf, because only now he realises what you said. _Oh, sorry. You should speak more clearly, young fellows._";
	text2 = "You look at him. He looks at you. _Oh yes! Your question. No. I can't offer you anything else. Sorry._ He starts writing again.";
	action = END_TALK;

// *** Cornelia ***

begintalknode 66;
	state = -1;
	personality = 34;
	nextstate = 25;
	condition = 1;
	question = "Cornelia";
	text1 = "This women is the owner of this rather large shop. Dresses and cloaks hang all over the place. Its probably a clothing shop.";
	text2 = "_Okay, so while you and your girlfriend make up your mind, I'm going to help these customers first. Is that all right?_ The man and women nod. _So, how can I help you guys?_";
	code =
		coins_before = coins_amount();
		set_flag(5,22,0);
		set_flag(5,14,0);
	break;

begintalknode 67;
	state = 25;
	personality = 34;
	nextstate = 26;
	condition = 1;
	question = "We'd like to buy some clothing.";
	text1 = "_What sort of clothing? We have armor, normal clothing and wedding dresses._ She smiles. Proud to present the big choice.";

begintalknode 68;
	state = 26;
	personality = 34;
	nextstate = 27;
	condition = 1;
	question = "We'd like to buy armor.";
	text1 = "The woman smiles at you. She doesn't really care if you bought anything or not, she just sits and smiles. At a certain point your stomach starts to protest somewhat. You start to feel sick. You quickly turn your head away. You feel better.";
	code =
		begin_shop_mode("Clothing from the Cow","You can choose out of several beautifully made pieces of armor.",13,2,-1);
	break;

begintalknode 69;
	state = 26;
	personality = 34;
	nextstate = 27;
	condition = 1;
	question = "I think we need some more clothing. Pants, shirts, you know.";
	text1 = "The woman smiles at you. She doesn't really care if you bought anything or not, she just sits and smiles. At a certain point your stomach starts to protest somewhat. You start to feel sick. You quickly turn your head away. You feel better.";
	code =
		begin_shop_mode("Clothing from the Cow","These tunics, shirts and pants are of good quality.",14,2,-1);
	break;

begintalknode 70;
	state = 28;
	personality = 34;
	nextstate = -1;
	condition = get_flag(5,14) == 0 && get_flag(5,22) == 1;
	question = "Yes, please.";
	text1 = "She takes a bag and puts your wares in it. _Anything else you'd like?_";
	code =
		set_flag(5,14,1);
	break;

begintalknode 71;
	state = 28;
	personality = 34;
	nextstate = -1;
	condition = get_flag(5,14) == 0 && get_flag(5,22) == 1;
	question = "No, thanks.";
	text1 = "She gives you your clothes. _Maybe I can help with something else?_";
	code =
		set_flag(5,14,1);
	break;

begintalknode 72;
	state = 26;
	personality = 34;
	nextstate = 27;
	condition = 1;
	question = "Could we see the wedding dresses?";
	text1 = "The woman smiles at you. She doesn't really care if you bought anything or not, she just sits and smiles. At a certain point your stomach starts to protest somewhat. You start to feel sick. You quickly turn your head away. You feel better.";
	code =
		begin_shop_mode("Clothing from the Cow","The wedding dresses are beautiful, but you don't need them. You could buy one of course, if you want.",15,2,-1);
	break;

begintalknode 73;
	state = 27;
	personality = 34;
	nextstate = 28;
	condition = 1;
	question = "What can you offer us?";
	text1 = "She looks surprised that you ask that question. _You are the customer, tell me what you want, rather than me telling you._";
	text2 = "She takes a bag from under the counter. _I can bag that stuff for you, for example._";
	code =
		if (coins_amount < coins_before) {
				remove_string(1);
				set_flag(5,22,1);
				}
		
		if (coins_amount == coins_before)
				remove_string(2);
	break;

// *** Fanggorn ***

begintalknode 74;
	state = -1;
	personality = 37;
	nextstate = 29;
	condition = 1;
	question = "Fanggorn";
	text1 = "The cool air of outside doesn't come here too often. It's very hot in this smithy. A man is working hard on a sword.";

begintalknode 75;
	state = 29;
	personality = 37;
	nextstate = 30;
	condition = 1;
	question = "Sorry, sir. may we interrupt you?";
	text1 = "_If you are clients, of course! Do you want to buy something?_ He stands up from his work.";

begintalknode 76;
	state = 30;
	personality = 37;
	nextstate = -1;
	condition = 1;
	question = "Yes, actually. We do.";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Fanggorn's Mighty Weapons","These swords are worth buying. Certainly for this price.",16,1,2);
	break;

begintalknode 77;
	state = 30;
	personality = 37;
	nextstate = -1;
	condition = 1;
	question = "Well, sorry. Actually we don't.";
	text1 = "_Then go away. You hold me up in my work._ That was quite rude. But as he already started hammering again, you go away.";
	action = END_TALK;

// *** Almost married couple ***

begintalknode 78;
	state = -1;
	personality = 37;
	nextstate = -1;
	condition = 1;
	question = "Almost married couple";
	text1 = "This couple looks married. They are looking at wedding dresses, so they probably aren't married yet. They look happy together. They seem, however, as if they can't decide what to take. You wouldn't disturb them in their thinking.";
	action = END_TALK;
	
// *** Cat ***

begintalknode 79;
	state = -1;
	personality = 35;
	nextstate = 32;
	condition = 1;
	question = "Cat";
	text1 = "There's a cat happily walking around here. It comes up to you and starts purring. _Meow._";

begintalknode 80;
	state = 32;
	personality = 35;
	nextstate = -1;
	condition = 1;
	question = "Its a nice cat. Yes, its a nice sweet cat, isn't it?";
	text1 = "Purrrr... _Meow._ You eventually decide to leave.";
	action = END_TALK;
	
// *** Prunella ***

begintalknode 81;
	state = -1;
	personality = 40;
	nextstate = 34;
	condition = 1;
	question = "Prunella";
	text1 = "This young women stands at the counter of her lodge. _Good day to you, folks. What can I do for you? Want a room? That's 5 coins._";

begintalknode 82;
	state = 34;
	personality = 40;
	nextstate = -1;
	condition = 1;
	question = "We'd like a room";
	text1 = "_That will be 5 coins, sir. You stay in the first room on your right. Go through the door here. She points at the door next to her.";
	text3 = "She looks at your very small embarrassing pile of coins. _I'm sorry, but for that amount I can't let you stay._";
	text5 = "She looks almost angry when you tell her you want a room. _What? On a horse in my lovely rooms!_ She kicks you out of her lodge.";
	action = INN 5 38 6;

begintalknode 83;
	state = 34;
	personality = 40;
	nextstate = 34;
	condition = 1;
	question = "So what do you do all day?";
	text1 = "_Just sit around. Would you like a room or not?_";
	
// *** Mayor Ruth after you come back from Thralni's castle (because you were kidnapped) ***

begintalknode 84;
	state = -1;
	personality = 29;
	nextstate = 35;
	condition = 1;
	question = "Mayor Ruth";
	text1 = "You come into Mayor Ruth's office. She looks up from her book. When she sees you, she is quite bewildered. _What happened! I only sent you to investigate that Creation thing you told me about, and you were away for at least three days!_";
	text2 = "You can calm her down eventually, although the way you look still worries her. Your clothes are torn and you look extremely tired.";
	text3 = "She looks up from her book when you come in. _What is it? Do you need help of some sorts?_";
	text4 = "You set one step into the mayor's office, and she immediately comes running to you, screaming that the Empire Liaison was kidnapped. You look at her with bewilderment. _Kidnapped!?_";
	text5 = "Mayor Ruth reads another book. When you come in to her office, she smiles pleasantly at you.";
	code =
		if (get_flag(5,12) == 0) { // you just got back from Thralni's castle firt time
				if (get_flag(5,18) == 0) {
						add_string(1);
						add_string(2);
						remove_string(3);
						remove_string(4);
						remove_string(5);
						}
				}
		
		if (get_flag(5,12) == 0) { // Ruth wants you to go once more to creation halls
				if (get_flag(5,18) == 1) {
						remove_string(1);
						remove_string(2);
						add_string(3);
						remove_string(4);
						remove_string(5);
						}
				}
		
		if (get_flag(5,12) == 1) { // liaison either not kidnapped, or you told Ruth already about him being dead
				if (get_flag(5,2) != 1) {
						remove_string(1);
						remove_string(2);
						add_string(3);
						remove_string(4);
						remove_string(5);
						}
				}

		if (get_flag(5,1) == 2) { // told Ruth about killing Thralni
				remove_string(1);
				remove_string(2);
				remove_string(3);
				remove_string(4);
				add_string(5);
				}

		if (get_flag(5,1) != 2) { // didn't tell Ruth yet about killing Thralni, but did get quest to find one responsible
				remove_string(1);
				remove_string(2);
				add_string(3);
				remove_string(4);
				remove_string(5);
				}

		if (get_flag(5,2) == 1) { // liaison kidnapped
				remove_string(1);
				remove_string(2);
				remove_string(3);
				add_string(4);
				remove_string(5);
				}
	break;

begintalknode 85;
	state = 35;
	personality = 29;
	nextstate = 36;
	condition = get_flag(5,18) == 0 && get_flag(5,2) != 1;
	question = "We have news of the greatest importance";
	text1 = "She looks at you with big eyes when you tell her about the mage that teleported you away. She is very surprised to hear he teleported you to Thralni's castle.";
	text2 = "_The Emperor? Thralni? Did he do this then? You must find it all out. I think the best thing to do is to go once more to the power level of the... What was it called again?_";

begintalknode 86;
	state = 36;
	personality = 29;
	nextstate = -1;
	condition = 1;
	question = "The Creation halls?";
	text1 = "_Ah yes, of course. You must go back there and find clues. Then come back to me. I may be able to help you. Was there anything else you wanted from me?_";
	text2 = "You ask her for some assistance. _Hmmm... Okay. I'll send about forty soldiers after you. They'll find their way. You just make sure you get to Thralni._";
	action = END_TALK;
	code =
		set_flag(5,18,1);
		set_flag(29,18,1);
	break;

begintalknode 87;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(5,18) == 1 && get_flag(5,1) != 2;
	question = "Could you tell us what our assignment was, please?";
	text1 = "She looks slightly irritated that you forgot this. _I told you to go back to the power level of the Creation halls, as there might be still some clues you may find, okay? Now go._";

begintalknode 88;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(8,9) == 1 && get_flag(41,0) == 0 && get_flag(5,2) != 0;
	question = "Mayor, we found this clue. Could you help us?";
	text1 = "You tell her about the strange rhyme you found. She thinks, but then shakes her head. _I suggest you should go to General Flamington, who is a traveller himself. He should be in Fort Filbert, if I remember correctly._";

begintalknode 89;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(5,1) == 1 && get_flag(41,0) == 1;
	question = "We found Thralni. He attacked us. We're sorry, but we had to kill him.";
	text1 = "_So you were right._ A tear drops on her dress. _I had hoped you had been mistaken, but I see I was wrong and you were right. Much pain has been suffered. Many people flew. Riverrod province won't be the same anymore._";
	text2 = "She stands up and walk towards you. _Nevertheless, I want to thank you very, very much. You have done a great deed, and I will make sure other provinces hear about it. You deserve a reward._";
	text3 = "She slowly walks out of the room and disappears around a corner. After some time she returns. _This sack of gold is for you. I hope you can do something with it._";
	text4 = "_Actually, we should meet. All mayors of all towns. We should discuss this matter and see what to do. A solution has to be found to attract people to this wrecked province._";
	text5 = "She looks you straight in the eyes while she says the following: _Again, I want to thank you. You have found the solution to the problems, and dealt with the things that were wrong. If you wish, you can leave Riverrod at one of the borders._";
	text6 = "After saying this last sentence, she sits down and folds her arms over each other and stares at you. Finally, she takes her book and starts reading again.";
	code =
		set_flag(18,1,2); // Stop displaying hqattach messages
		set_flag(5,12,1); // Use? Probably to signify that you killed Thralni (quest accomplished), although flag seems unnecessary
		set_flag(5,1,2); // quest completed
		toggle_quest(10,0);
		change_coins(1000);
		char_give_item(0,278);
		award_party_xp(250,20);
	break;

begintalknode 90;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(5,1) == 2 && get_flag(5,2) != 1;
	question = "How have things been going since we killed Thralni?";
	text1 = "She puts her book down (she started reading a new book). _It is still too early to tell, but I think things will go better with time. Some people already returned to their homes. Trade is going better too._";
	text2 = "_Still, I can't believe it was really Thralni. Thralni, our beloved Emperor._ A tear appears in her eye, in the beginning small, but as time goes by it grows bigger too, until it drops on her dress.";
	text3 = "_I didn't meet with the other mayors to discuss situations as yet, but I will. People must return, trade must continue, life has to go on. These are my final words. You probably want to go back to your homes. Then go. You've done enough._";
	text4 = "Mayor Ruth nods and smiles. The memory remains _...You have done enough._";

begintalknode 91;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,3) < 1 && get_flag(5,2) == 1;
	question = "Was the Empire Liaison kidnapped!? But how!";
	text1 = "_They came at night and kidnapped him. You must go and look for him. I fear for his life._";
	code =
		toggle_quest(2,1);
		set_flag(5,3,1);
		set_town_visibility(7,1);
	break;
	
begintalknode 92;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(7,0) == 1 && get_flag(5,3) <=1 && get_flag(5,2) == 1 && get_flag(5,4) <= 1;
	question = "We found the Empire Liaison, but we're afraid he is dead.";
	text1 = "_Oh no. I was afraid this would happen. When people get kidnapped you know, you always keep hoping, but I already had the feeling, that..._";
	text2 = "You leave her alone. Before you can leave however, she calls you back. _There were some scrolls stolen. If you happen to find them, come back to me._";
	code =
		toggle_quest(2,0);
		toggle_quest(3,1);
		set_flag(5,3,2);
		set_flag(5,4,1);
		set_flag(5,2,2);
	break;

begintalknode 93;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,4) == 1;
	question = "We would like to discuss something about the stolen scrolls";
	text1 = "She sits and smiles. But when you tell her what you know, that smile quickly fades.";
	text2 = "You tell her what you discovered. When you tell her of the book and the hard-to-read words which makes you suspect people of Thralni maybe kidnapped the Empire Liaison, she becomes furious.";
	text3 = "_How dare you say that about Emperor Thralni!_ You quickly move away.";
	text4 = "When you tell her about what you found in Thralni's castle, she looks very alarmed. _This could be the beginning of a war between Thralni and the Empire!_ She sits down. Her face look unusually pale.";
	text5 = "You come and sit next to her and show her the scrolls. _Yes, these are indeed the stolen scrolls. I can't believe it._ She sighs and takes the scrolls off you.";
	text6 = "She becomes angry when you tell her things she already knows. _Have you come to waste my time for this!_ A bit shocked you walk out. Can such a nice lady be so rude?";
	code = 
		if (get_flag(8,8) != 1) {
				if (get_flag(4,1) != 1) {
						remove_string(2);
						remove_string(3);
						remove_string(4);
						remove_string(5);
						}
				}
	
		if (get_flag(8,8) == 1) {
				remove_string(4);
				remove_string(5);
				remove_string(6);
				set_flag(8,8,2);
				}
		
		if (get_flag(4,1) == 1) {
				remove_string(2);
				remove_string(3);
				remove_string(6);
				set_flag(5,4,2);
				toggle_quest(3,0);
				award_party_xp(40,10);
				change_coins(100);
				}
	break;

begintalknode 94;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,3) == 1;
	question = "Is there any news about the Empire Liaison?";
	text1 = "The worry on Mayor Ruth's face fades away and makes place for a rather irritated expression. _I thought you were the one to bring me the news!? Go! Go look for the poor man!_";

begintalknode 96;
	state = 35;
	personality = 29;
	nextstate = 37;
	condition = get_flag(5,25) == 1;
	question = "By the way, where did you get most of your information about the Senarti from?";
	text1 = "She scratches behind her ear. _From Flanagan, the mage of Pleasantville. Why do you ask that?_";

begintalknode 97;
	state = 37;
	personality = 29;
	nextstate = 35;
	condition = 1;
	question = "Well, we sort of forgot to tell you about it, but Benthol says you shouldn't believe everything he says.";
	text1 = "Now she nods at you. _Yeah, I know, but you proved him right, didn't you? There were indeed conspiracies between humans and the Senarti. Heavens, our own Emperor betrayed us!_";

begintalknode 98;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(4,3) == 1;
	question = "We found evidence in Thralni's castle for a planned murder on you, Mayor.";
	text1 = "You present her with the note, and Mayor Ruth falls silent. _He actually wanted to kill me._ She begins to to cry. You decide to leave her alone.";
	action = END_TALK;
	code =
		change_spec_item(11,-1);
		set_flag(4,3,2);
	break;

begintalknode 99;
	state = 35;
	personality = 29;
	nextstate = 38;
	condition = 1;
	question = "What tasks do you have?";
	text1 = "_Nothing of too much importance. I deal with budgets, all kinds of laws, send police when they are needed, that sort of thing. Naturally, there are things I can not do._";

begintalknode 100;
	state = 38;
	personality = 29;
	nextstate = 39;
	condition = 1;
	question = "What things may that be?";
	text1 = "_Well, there have been some problems lately. And... I wondered if you can help me out?_";
	text3 = "_Did you eliminate the bandits already? No, you didn't. First eliminate them, and then I'll see if there is more to do._ She returns to her book again.";
	text5 = "_At the moment nothing, actually. You eliminated the most immediate threat this city had already._ She doesn't look disappointed when saying this, she is glad there is no threat to the city! _Of course, we have the Senarti..._";
	code =
		if (get_flag(5,0) == 0) {
				remove_string(3);
				remove_string(5);
				}
				
		if (get_flag(5,0) == 1) {
				remove_string(1);
				remove_string(5);
				}
				
		if (get_flag(5,0) == 2) {
				remove_string(1);
				remove_string(3);
				}
		break;
	
begintalknode 101;
	state = 38;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,0) == 0;
	question = "Well of course!";
	text1 = "_Thanks very much. Several bandits live in the sewers of this town. No police officer or guard wants to go down because of poison fungi, rats, bats and a very annoying smell. If you could get rid of the bandit leader, I would be grateful._";
	text2 = "The entrance to the sewers is in a small cabin at the south end of town. You can't miss it. It's guarded by two guards.";
	code = 
		set_flag(5,0,1);
		set_flag(5,11,1);
		toggle_quest(1,1);
	break;

begintalknode 102;
	state = 35;
	personality = 29;
	nextstate = -1;
	condition = get_flag(5,0) == 1 && get_flag(6,1) == 1;
	question = "We killed them all! Wow, that was fun!";
	text1 = "She smiles at you. She is clearly relieved at least one threat has been taken care off. _Very good. You deserve a reward._ She claps her hands, and a guard brings you a sack of gold.";
	code = 
		toggle_quest(1,0);
		set_flag(5,0,2);
		award_party_xp(100,30);
	break;

begintalknode 103;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(6,5) == 1;
	question = "We found this note in the bandit leader's desk.";
	text1 = "She takes the note. Her smile fades away and she looks worried. _This is serious. These bandits were actually helping the Senarti! On this letter to the chief bandit, there is a whole description of how to kidnap the Empire Liaison!_";
	text2 = "She takes the note. Her smile fades away and she looks worried. _In this letter there is a complete explanation of how the Empire Liaison should have been kidnapped!_ She turns her head away. _It seems they succeeded._";
	text3 = "After reading the note, she falls down in her chair, and starts breathing heavily. She doesn't look healthy at all, and her skin is a bit pale.";
	code =
		if (get_flag(5,2) == 0) {
				remove_string(2);
				change_spec_item(9,-1);
				set_flag(6,5,2);
				}
		
		if (get_flag(5,2) != 0) {
				remove_string(1);
				change_spec_item(9,-1);
				set_flag(6,5,2);
				}
	break;

begintalknode 104;
	state = 35;
	personality = 29;
	nextstate = 35;
	condition = get_flag(6,1) == 1 && get_flag(5,0) == 2;
	question = "How have things been going since we got rid of the bandits?";
	text1 = "_Quite good, thank you. Disturbances have been smaller, and the people seem happier. Its also less noisy and messy in town._";

// NOTE: last state of mayor Ruth is 35, Benthol's states continue at 40! The states 38 - 39 are still unused!

// *** Benthol after killing of Thralni ***

begintalknode 105;
	state = -1;
	personality = 38;
	nextstate = 40;
	condition = 1;
	question = "Benthol";
	text1 = "Benthol, the old mage, is still sitting in his chair. He looks very tired. When he notices you coming in, he opens his right eye, and stares at you for some time, while his eye rolls from up and down, checking you over.";
	text2 = "Finally, his eye stops moving. He opens his other eye, and stares at you with a faint smile. Then he looks at the wall. The scepter. He stares back at you. _What can I do for you?_";

begintalknode 106;
	state = 40;
	personality = 38;
	nextstate = 41;
	condition = get_flag(5,23) == 0;
	question = "We killed him. Thralni.";
	text1 = "The smile promptly disappears. It is replaced with a grin, growing in magnitude with every second that passes. Finally, he bursts out laughing.";
	text2 = "_Whahahaha! You can't be serious! You? Kill the mighty Thralni!?_ How rude, is all you can think. He doesn't seem very convinced that you really killed him.";

begintalknode 107;
	state = 41;
	personality = 38;
	nextstate = 42;
	condition = has_item(478) == 1 && get_flag(105,0) < 2;
	question = "Then what's this, eh? (Show him Thralni's ring, which you found when he died)";
	text1 = "He stops laughing and looks at the ring, his eyes getting large. He extends his hand, but you keep the ring well away from him. He looks at you and then at the ring, after which he opens his mouth and tries to say something.";
	text2 = "His first expression is to gasp. _That... that... is one of the most valuable artefacts I know of. The mighty ring of Thralni... please, if I can, can I buy it off you?_ He stares at you with big, hopeful eyes, awaiting your answer._";

begintalknode 108;
	state = 41;
	personality = 38;
	nextstate = 40;
	condition = has_item(478) == 0 && get_flag(105,0) < 2;
	question = "You're right, we don't have any proof.";
	text1 = "His laughter stops, and a wicked smile takes its place. _I knew it! You don't have any proof! Now, tell me some serious stuff, not your fantasies._";
	text2 = "You stare at him in disbelief. In the end you tell him about everything you saw and found, yet you don't tell him about the diary you found. The diary including his name. He seems to start to believe you now.";
	code =
		set_flag(5,23,1); // You can't say again that you killed Thralni
	break;

begintalknode 109;
	state = 42;
	personality = 38;
	nextstate = 43;
	condition = 1;
	question = "How much will you give me for it?";
	text1 = "He stands up, walks to the bed, and takes a small pouch from under the blankets. Before he opens the pouch, he mutters a spell. He then opens the pouch and turns it upside down above the table.";
	text2 = "_2500 coins. What do you say?_";

begintalknode 110;
	state = 43;
	personality = 38;
	nextstate = 40;
	condition = 1;
	question = "Of course! (Sell the ring)";
	text1 = "Benthol's face lightens up. he takes the pouch, puts the coins back in, in a hasty manner. He then closes it with a small string, and hands it over to you. You open it, take a coin and bite on it. Gold.";
	text2 = "You take the ring and hand it over to Benthol, who takes it over from you with shaking fingers. He looks at it and studies it carefully, until he walks to a closet and carefully places the ring on an empty stand. _My collection is complete._";
	code =
		set_flag(105,0,2); // sold the ring
		set_flag(5,23,1); // You can't say again that you killed Thralni
		take_item(478);
		change_coins(2500);
		award_party_xp(25,10);
	break;

begintalknode 111;
	state = 43;
	personality = 38;
	nextstate = 40;
	condition = 1;
	question = "No, we're sorry (Keep the ring)";
	text1 = "_Oh,_ he says. The disappointment can be read on his face. He takes the pouch, enchants it again, and puts it under his bed, from where he took it. He then turns back to you.";
	text2 = "_If you do want to sell it, and make the day of an old man, be sure to come back, okay?_ You nod in agreement.";
	code =
		set_flag(105,0,1); // didn't sell the ring as yet
		set_flag(5,23,1); // You can't say again that you killed Thralni
	break;

begintalknode 112;
	state = 40;
	personality = 38;
	nextstate = 43;
	condition = has_item(478) == 1 && get_flag(105,0) == 1;
	question = "What did you want to give us for the ring?";
	text1 = "He stands up, walks to the bed, and takes a small pouch from under the blankets. Before he opens the pouch, he mutters a spell. He then opens the pouch and turns it upside down above the table.";
	text2 = "_2500 coins. What do you say?_";

begintalknode 113;
	state = 40;
	personality = 38;
	nextstate = 44;
	condition = get_flag(5,23) == 1;
	question = "So how have you been doing?";
	text1 = "He points to his collection of antiques. It looks the same as when he showed it to you a few days ago. _What do you see?_";

begintalknode 114;
	state = 44;
	personality = 38;
	nextstate = 40;
	condition = get_flag(105,0) == 1;
	question = "Um... It still looks the same.";
	text1 = "He folds his arms over each other and nods. _Indeed. That collection shows how I am doing. You killed Thralni you say? Well, it certainly didn't really help me, did it. However, if you sell me the ring, I would feel much better._";

begintalknode 115;
	state = 44;
	personality = 38;
	nextstate = 40;
	condition = get_flag(105,0) == 2;
	question = "Well, apart from the ring it looks the same.";
	text1 = "He looks at the ring with begging eyes, eyes full of love and hope. He then turns to you, and says: _Yeah. The ring. The collection shows how I am doing. As I just acquired the ring, I am doing quite well, thank you._";

begintalknode 116;
	state = 40;
	personality = 38;
	nextstate = 45;
	condition = get_flag(5,24) == 0;
	question = "You know, we found Thralni's diary. YOU were mentioned in it.";
	text1 = "He gulps and suddenly looks quite frightened. _You know it, don't you?_ You nod, though you have no clue what he is talking about. _Right. I'll just tell you my story, won't I?_";
	text2 = "He begins talking. _It was when the Empire invaded the Thraldom, and our armies, the Thraldom armies, lost the battle. Emperor Thralni had to go into hiding. He wanted revenge on the Empire, obviously. I was one of his high-ranking magi._";
	text3 = "_Suddenly, Emperor Thralni disappeared. We received a message from him after a few months, saying something about a temple and strange altars. By then we had already started building that big underground fort._";
	text4 = "_We went looking for him and sure enough, when we found him, we found the altars. It was a strange sight. Anyway, we started testing, experimenting on them. By total luck, we discovered its ability._";
	
begintalknode 117;
	state = 45;
	personality = 38;
	nextstate = 46;
	condition = 1;
	question = "(Continue)";
	text1 = "The old man thinks for a while, and continues talking. _A guard came running to us, reporting about the outside world. The Empire had begun construction on the big Riverrod (we were shocked to hear this new name) Empire Headquarters._";
	text2 = "Emperor Thralni was furious when he heard it, and in his rage pressed a button, which he regretted pressing right after he had done it. A small white beam erupted from the left altar, and hit the poor guard. He became very strong._";
	text3 = "_And that was the beginning of the Senarti. Now I helped Thralni with his sick plan, but when I heard what the plan really was, I tried to stop him. He sacked me and threw me out of the castle. That's why I helped you._";
	text4 = "_And I didn't only help you with getting into the castle. That book you found in the castle? With the spell and all that? I placed it. I could get into the castle. I planted it, and waited for a hero to come. You._";


begintalknode 118;
	state = 40;
	personality = 38;
	nextstate = 45;
	condition = get_flag(5,24) == 1;
	question = "That research you told us about earlier... We found Thralni's diary, and you were mentioned in it. Care to explain?";
	text1 = "He gulps and suddenly looks quite frightened. _You know it, don't you?_ You nod, though you have no clue what he is talking about. _Right. I'll just tell you my story, won't I?_";
	text2 = "He begins talking. _It was when the Empire evaded the Thraldom, and our armies, the Thraldom armies, lost the battle. Emperor Thralni had to go into hiding. He wanted revenge on the Empire, obviously. I was one of his high-ranking magi._";
	text3 = "_Suddenly, Emperor Thralni disappeared. We received a message from him after a few months, saying something about a temple and strange altars. By then we had already started building that big underground fort._";
	text4 = "_We went looking for him and sure enough, when we found him, we found the altars. It was a strange sight. Anyway, we started testing, experimenting on them. By total luck, we discovered its ability._";
	
begintalknode 119; // this node was the same as node 117, but it wasn't necessary anymore
	state = -1;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "";
	
	
begintalknode 120;
	state = 46;
	personality = 38;
	nextstate = 47;
	condition = 1;
	question = "But... but...";
	text1 = "_But what!_ Angrily he bangs on the table. He is not pleased with this sudden revelation you forced him to make. Nonetheless, it is good that you know of it now. You won't tell it to other people.";
	text2 = "You keep hanging around for a bit, asking about some petty details. Overall, you are flabbergasted, but it explains a lot.";

begintalknode 121;
	state = 47;
	personality = 38;
	nextstate = 48;
	condition = 1;
	question = "So you actually knew quite a lot about the Senarti. Why didn't you help us with that, then?";
	text1 = "Now he is the one being flabbergasted. _Well why do you think!?_";
	
begintalknode 122;
	state = 48;
	personality = 38;
	nextstate = 49;
	condition = 1;
	question = "Because it would be a too dangerous of an action?";
	text1 = "He nods. _Yeah, indeed. If I would tell you about my history, you would probably also have forced me to come with you, or you would tell everybody about it. I didn't want that._";
	text2 = "It seems a logical explanation. You feel cheated though. You wish you had known it for a long time, you wish the guy would have helped you, as it just doesn't seem fair to have done all this work, when you could have cut corners.";

begintalknode 123;
	state = 48;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "Because you are a boring ass?";
	text1 = "_WHAT!_ That certainly enraged the old mage. _WHAT did you say!?_ His head starts turning red, which seems logical, seeing as how tension builds up in the old man's body.";
	text2 = "In the end he turns away from you and orders you to go out. You leave.";
	action = END_TALK;

begintalknode 124;
	state = 49;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "That was very interesting. Thank you very much.";
	text1 = "Tiredly, he nods. _My pleasure._ You don't believe that. He doesn't seem pleased at all that you know of it. You leave, eventually.";
	action = END_TALK;

begintalknode 125;
	state = -1;
	personality = 38;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "";

// NOTE: last state of Benthol is 47, Boris' states continue at 50! The states 48 - 49 are still unused!


// *** Boris after HQ attack ***

begintalknode 126;
	state = -1;
	personality = 39;
	nextstate = 50;
	condition = 1;
	question = "Boris";
	text1 = "The once cheerful bartender is very depressed. You look around he inn and see why. Because of the recent attacks, the inn is deserted, which is a pity. Its a nice place.";
	text2 = "Boris, the bartender, notices you coming in, and immediately jumps upon you. _Please! This is a nice inn, will you you take a room? Food I don't have anymore, I'm afraid._";

begintalknode 127;
	state = 50;
	personality = 39;
	nextstate = -1;
	condition = 1;
	question = "We'd like to have a room, please.";
	text1 = "He takes your coins and brings you to your rooms. _Here's your rooms. I'm sorry, but we offer no breakfast._ He walks away to the tavern.";
	text3 = "_Sorry sir, but we don't have enough money..._ You say, a little embarrassed. _Then no room for you, sonny._";
	text5 = "_Horses are not allowed in the rooms._";
	action = INN 10 20 32;

begintalknode 128;
	state = 50;
	personality = 39;
	nextstate = 50;
	condition = 1;
	question = "No, thanks. We just want a small chat.";
	text1 = "He looks you straight in the eyes, and answers plainly: _I am in no mood for a chat._";

begintalknode 129;
	state = 50;
	personality = 39;
	nextstate = 51;
	condition = 1;
	question = "How is business?";
	text1 = "He points to several empty chairs. _How does it look, eh? Because of the recent attacks it has been so bad that I might need to close this place down!_ This shocks you. You must do something to get tourism going again.";

begintalknode 130;
	state = 51;
	personality = 50;
	nextstate = -1;
	condition = 1;
	question = "We are so sorry to hear that.";
	text1 = "_I bet you are._ He turns his head away. _Please take a room, do it for me, for the tavern. Take a room to keep this goddamn place open if you are so sorry for it to close._ It would be a nice gesture to help.";

// *** Empire HQ official ***

begintalknode 131;
	state = -1;
	personality = 94;
	nextstate = -1;
	condition = 1;
	question = "Empire HQ leader";
	text1 = "The chief of the Riverrod Empire Headquarters is currently talking to Mayor Ruth. Probably about you, as you hear your names being mentioned several times. You leave him be.";